package com.laituo.juyou.app.api.recommend;

import com.laituo.juyou.core.annotation.HttpMethod;
import com.laituo.juyou.core.annotation.HttpOpenApi;
import com.laituo.juyou.core.annotation.HttpParam;
import com.laituo.juyou.core.annotation.HttpParamType;
import com.laituo.juyou.core.annotation.param.NotNull;
import com.laituo.juyou.core.exception.ServiceException;
import com.laituo.juyou.data.dto.RecommendDTO;
import com.laituo.juyou.data.dto.RecommendGoodDTO;
import com.laituo.juyou.data.model.Page;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: kbq
 * Date: 2019-07-08
 * Time: 下午3:33
 *
 * @author xuyang
 */

@HttpOpenApi(group = "recommend", description = "推荐商品接口")
public interface RecommendService {
    /**
     * 指定仓库id根据传入推荐类型获得对应类型推荐商品
     *
     * @param storageId     仓库id
     * @param recommendType 所需推荐类型
     * @param pageNo        页码
     * @param pageSize      页面长度
     * @return Page<RecommendDTO>
     * @throws ServiceException 异常信息
     */
    @HttpMethod(description = "指定仓库id根据传入推荐类型获得对应类型推荐商品")
    Page<RecommendDTO> getRecommendByStorage(
            @NotNull @HttpParam(name = "storageId", type = HttpParamType.COMMON, description = "仓库id") Long storageId,
            @NotNull @HttpParam(name = "recommendType", type = HttpParamType.COMMON, description = "所需推荐类型") Integer recommendType,
            @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer pageNo,
            @HttpParam(name = "pageSize", type = HttpParamType.COMMON, description = "页面长度", valueDef = "10") Integer pageSize) throws ServiceException;


    /**
     * 根据仓库id,商品id查询商品和推荐商品
     *
     * @param storageId     仓库id
     * @param recommendType 所需推荐类型
     * @param id            商品id
     * @return RecommendGoodDTO
     * @throws ServiceException 异常信息
     */
    @HttpMethod(description = "指定仓库id根据传入商品id获得对应类型推荐商品")
    RecommendGoodDTO getRecommendByStorageAndId(
            @NotNull @HttpParam(name = "storageId", type = HttpParamType.COMMON, description = "仓库id") Long storageId,
            @NotNull @HttpParam(name = "recommendType", type = HttpParamType.COMMON, description = "所需推荐类型") Integer recommendType,
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "商品id") Integer id) throws ServiceException;

}
